﻿using System;
using System.ComponentModel;
using System.Globalization;

namespace DenisVuyka.Controls.PropertyGrid
{
  public abstract class FontConverterDecorator : TypeConverter
  {
    private readonly TypeConverter converter;

    protected FontConverterDecorator(TypeConverter converter)
    {
      this.converter = converter;
    }

    #region TypeConverter implementation
    public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType)
    {
      return this.converter.CanConvertFrom(context, sourceType);
    }

    public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType)
    {
      return this.converter.CanConvertTo(context, destinationType);
    }

    public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)
    {
      return this.converter.ConvertFrom(context, culture, value);
    }

    public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
    {
      return this.converter.ConvertTo(context, culture, value, destinationType);
    }

    public override bool GetStandardValuesSupported(ITypeDescriptorContext context)
    {
      return true;
    }
    #endregion
  }  
}
